/**
 * \file point.cpp
 * \brief Point class implementation
 * \author Marc Laval
 * \version 0.1
 * \date 10/2011
 *
 */

#include "point.h"

//--------------------------------------------------------------------------------------------------------
/*! \brief Default constructor
 */
Point::Point(){
	this->x = 0;
	this->y = 0;
}

//--------------------------------------------------------------------------------------------------------
/*! \brief Constructor
 *  \param x x coordinate
 *  \param y y coordinate
 */
Point::Point(int x, int y){
	this->x = x;
	this->y = y;
}

//--------------------------------------------------------------------------------------------------------
/*! \brief Copy constructor
 *  \param copy Point to copy
 */
Point::Point(Point& copie){
	this->x = copie.getX();
	this->y = copie.getY();
}

//--------------------------------------------------------------------------------------------------------
/*! \brief X getter
 *  \return X value
 */
int Point::getX(){
	return this->x;
}

//--------------------------------------------------------------------------------------------------------
/*! \brief Y getter
 *  \return Y value
 */
int Point::getY(){
	return this->y;
}

//--------------------------------------------------------------------------------------------------------
/*! \brief X setter
 *  \param x X value
 */
void Point::setX(int x){
	this->x = x;
}

//--------------------------------------------------------------------------------------------------------
/*! \brief Y setter
 *  \param y Y value
 */
void Point::setY(int y){
	this->y = y;
}

//--------------------------------------------------------------------------------------------------------
/*! \brief X and Y setter
 *  \param x X value
 *  \param y Y value
 */
void Point::setXY(int x, int y){
	this->x = x;
	this->y = y;
}

//--------------------------------------------------------------------------------------------------------
/*! \brief "Equal to" operator
 *  \param p Point to compare
 *  \return true if equal, false otherwise
 */
bool Point::operator==(Point& p){
	return (this->x == p.getX()) && (this->y == p.getY());
}

//--------------------------------------------------------------------------------------------------------
/*! \brief Setter operator
 *  \param p Point
 *  \return pointer to the setted point instance
 */
Point* Point::operator=(Point& p){
	this->x = p.getX();
	this->y = p.getY();
	return this;
}
//--------------------------------------------------------------------------------------------------------
